package com.dykj.fireFighting.web;

import com.dykj.fireFighting.api.base.devHisResult.service.IDevHisResultService;
import com.dykj.fireFighting.api.base.emergency.service.IEmergencyStaffService;
import com.dykj.fireFighting.api.base.news.service.IAliMessageService;
import com.dykj.fireFighting.api.base.push.service.PushService;
import com.dykj.fireFighting.api.elasticsearch.devHis.service.EsDevHisService;
import com.dykj.fireFighting.api.elasticsearch.devHisWater.service.EsDevHisWaterService;
import com.dykj.fireFighting.api.elasticsearch.devHisZc.service.EsDevHisZcService;
import com.dykj.fireFighting.web.rocketmq.consumer.*;
import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

/**
 * 硬件模块
 *
 * @author zcf
 */
@EnableDubbo
@EnableDiscoveryClient
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class,})
@MapperScan("com.dykj.fireFighting.web.mapper")
@EnableAspectJAutoProxy
public class DykjHardwareNewApplication {
    @DubboReference
    IAliMessageService iAliMessageService;
    @DubboReference(interfaceName = "social")
    private PushService pushService;
    @DubboReference
    private EsDevHisService esDevHisService;
    @DubboReference
    private EsDevHisZcService esDevHisZcService;
    @DubboReference
    private IDevHisResultService devHisResultService;
    @DubboReference
    private EsDevHisWaterService esDevHisWaterService;
    @DubboReference
    private IEmergencyStaffService iEmergencyStaffService;

    public static void main(String[] args) {
        SpringApplication.run(DykjHardwareNewApplication.class, args);
        System.out.println("(♥◠‿◠)ﾉﾞ  硬件模块启动成功   ლ(´ڡ`ლ)ﾞ  \n" +
                " .-------.       ____     __        \n" +
                " |  _ _  \\       \\   \\   /  /    \n" +
                " | ( ' )  |       \\  _. /  '       \n" +
                " |(_ o _) |        _( )_ .'         \n" +
                " |(_ o _) |    ___(_ o _)'          \n" +
                " |(_ o _) |    ||   |(_,_)'         \n" +
                " | (_,_)  |    |   `-'  /           \n" +
                " |       //     \\      /           \n" +
                " '-------`        `-..-'              ");

    }

    @Bean("aliMessageService")
    public IAliMessageService getAliMessageService() {
        return iAliMessageService;
    }

    @Bean("pushService")
    public PushService getPushService() {
        return pushService;
    }

    @Bean("esDevHisService")
    public EsDevHisService esDevHisService() {
        return esDevHisService;
    }

    @Bean("esDevHisWaterService")
    public EsDevHisWaterService esDevHisWaterService() {
        return esDevHisWaterService;
    }

    @Bean("esDevHisZcService")
    public EsDevHisZcService esDevHisZcService() {
        return esDevHisZcService;
    }

    @Bean("devHisResultService")
    public IDevHisResultService devHisResultService() {
        return devHisResultService;
    }

    @Bean
    public InsertDevHisConsumer getInsertDevHisConsumer() {
        return new InsertDevHisConsumer();
    }
    @Bean
    public FirePushConsumer getFirePushConsumer(){
        return new FirePushConsumer();
    }

    @Bean
    public SXinPushConsumer getSXinPushConsumer(){
        return new SXinPushConsumer();
    }
    @Bean
    public InsertDevHisWaterConsumer getInsertDevHisWaterConsumer(){
        return new InsertDevHisWaterConsumer();
    }

    @Bean
    public WaterPushConsumer getWaterPushConsumer(){
        return new WaterPushConsumer();
    }

    @Bean
    public InsertDevHisZcConsumer getInsertDevHisZcConsumer() {
        return new InsertDevHisZcConsumer();
    }

    @Bean
    public ZcPushConsumer getZcPushConsumer() {
        return new ZcPushConsumer();
    }



    @Bean("iEmergencyStaffService")
    public IEmergencyStaffService iEmergencyStaffService(){return iEmergencyStaffService;}
}
